<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="stmain"/>
  <link rel="stylesheet" href="${resource(dir: 'css', file: 'create.css')}" type="text/css"/>
  <title>SimTester - Running Tests</title>
</head>
<body>
  <h2>Running Tests</h2>
  <div class="tablepagination">
  <table class="sttable">
    <thead>
      <tr>
        <th>ID</th>
        <th>Execution Name</th>
        <th>Type</th>
        <th>Status</th>
        <th>Start Date</th>
        <th>End Date</th>
        <th> </th>
      </tr>
    </thead>
    <tbody>
      <g:if test="${testruns}">
      <g:each in="${testruns}" var="r">
        <tr title="ID: ${r.id}">
          <td>${r.id}</td>
          <td>${r.name}</td>
          <td>${r.type}</td>
          <td>${r.status}</td>
          <td><g:formatDate date="${r.dateCreated}" format="MM/dd/yyyy HH:mm:ss"/></td>
          <td><g:formatDate date="${r.endDate}" format="MM/dd/yyyy HH:mm:ss"/></td>
          <td>
            <g:link name="view" controller="testRun" action="results" params="[id: r.id]">View</g:link>
          </td>
        </tr>
      </g:each>
      </g:if>
	  <g:else>
         <tr>
            <td colspan="6" align="center">You have no running tests yet</td>
         </tr>
      </g:else>
      
      
    </tbody>
  </table>
  <div class="pagination">
	<g:paginate prev="&#8592; Previous" next="Next &#8594;" maxsteps="2" max="10" controller="testRun" action="running" total="${testrunscount}" />
  </div>
  </div>
</body>
</html>